<template>
	<view class="page-index">
		<view class="bar-area">
			<view class="fc-white fs30" @click="loginOut" :style="showQuitBtn?'':'visibility: hidden;'">退出</view>
			<view class="flex-row" @click="areaChange">
                <view class="fc-white fs35">仪器设备</view>
            </view>
			<view class="fc-white fs30">{{ loginUser && loginUser.YHXM }}</view>
		</view>
		<!-- <view class="scan-tips"> 请扫描输液贴 </view> -->

		<!-- <view style="position:absolute;top:0rpx;left:100rpx;">
			<view @click="switchUrl()">切换地址</view>
		</view> -->
		<web-view :src="equipmentUrl" frameborder="0" style="width: 100%; height: calc(100% - 230rpx);position:absolute;top:100rpx;"></web-view>

	</view>
</template>

<script>
import { mapState } from "vuex"
import { logout } from "@/api/utils.js"
import { 
	getDateTimeString,
	getAdviceType,
	showToast,
} from "@/static/js/common.js"

export default {
	components: {},
	props: {
		showQuitBtn: {
			type: Boolean,
			default:function () {
				return true
			}
		},
	},
	data() {
		return {
			equipmentUrl:'',
		}
	},
	watch: {
		
	},
	computed: {
		...mapState(["loginUser", "area"]),
		
	},
	beforeDestroy(){
		uni.$off('scanCodeEmit');//取消监听
	},
	mounted() {
		this.equipmentUrl = `http://172.16.0.230:8081/pdaweb/index.html?USER_NAME=${this.loginUser.YHXM}&USER_ACCOUNT=${this.loginUser.YHDM}`;
		console.log("当前登陆人信息：", this.loginUser)
		console.log("当前路径：", this.equipmentUrl)
	},
	methods: {
		switchUrl(){//切换路劲测试
            this.equipmentUrl = 'http://www.baidu.com';
        }
	},
}
</script>

<style lang="scss">
.scan-tips {
	text-align: center;
	background-color: #faefe4;
	font-size: 30rpx;
	color: #ff9a27;
	padding: 10rpx 0rpx;
}
.bar-area {
	height: 100rpx;
	background-color: $bs-color-primary;
	display: flex;
	flex-direction: row;
	align-items: center;
	font-size: 30rpx;
	justify-content: space-between;
	padding: 0 30rpx;
}
.scroll-view {
	width: 100%;
	height: calc(100% - 200rpx);
	background-color: #f3f5f7;
	padding-bottom: 20rpx;
}
.item-area {
	margin: 20rpx 20rpx 0 20rpx;
	background-color: #ffff;
	border-radius: 10rpx;
	padding: 10rpx;
}
.item-title {
	padding: 6rpx 10rpx 12rpx 10rpx;
	display: flex;
	border-bottom: 1px solid #ebeef5;
}
.item-line {
	width: 1rpx;
	background-color: #d6d7d9;
	height: 46rpx;
	width: 2rpx;
}

.item-body {
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 0 10rpx;
}
.item-body-top {
	display: flex;
	flex-direction: row;
	align-items: center;
	margin-bottom: 10rpx;
}
.item-check-status {
	width: 150rpx;
	font-size: 27rpx;
	margin-left: auto;
	font-weight: bold;

	.item-check-no {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 8rpx 15rpx;
		border-radius: 8rpx;
		background-color: #fff5ea;
		background-position: center;
	}
	.item-check-yes {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 8rpx 15rpx;
		border-radius: 8rpx;
		background-color: #26bf4017;
		background-position: center;
	}
}

.item-brch {
	width: 98rpx;
	font-size: 30rpx;
	color: #e06263;
	font-weight: bold;
}

.item-content {
	font-size: 28rpx;
	padding: 15rpx 10rpx 4rpx 10rpx;
	display: flex;
	.item-content-icon {
		font-size: 25rpx;
		padding: 4rpx 8rpx;
		border-radius: 8rpx;
		background-color: #fff5ea;
		color: #ff9a27;
		width: 28rpx;
		height: 37rpx;
		margin-right: 10rpx;
	}
	.item-content-list {
		padding: 6rpx 8rpx;
		.list-item {
			display: flex;
			margin-bottom: 6rpx;
			.item-name {
				color: #262626;
				margin-right: 20rpx;
			}
			.item-amount {
				color: #4088fe;
			}
			.item-freq {
				color: #262626;
				margin-left: 20rpx;
			}
		}
	}
}
.check-datetime {
	font-size: 25rpx;
	color: #909399;
	padding: 0rpx 12rpx 8rpx 12rpx;
}
</style>
